package com.xiaotu.core.utils;

import sun.util.calendar.LocalGregorianCalendar;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author xiaotu
 * @Description //TODO
 * @Date 2022/1/12 10:05
 * @ClassName TestDate
 * @Version 1.0
 **/
public class TestDate {
    public static void main(String[] args) {
        Date date = new Date();
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = dateFormat.format(date);
        String stringDate = format+"";
        System.out.println("____________>"+stringDate);
        System.out.println("======>"+format);
        try {
            Date parse = dateFormat.parse(format);
            System.out.println("===========>"+parse);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
